package com.dragon.mmochat.model.task;

import java.io.Serializable;

import com.dragon.mmochat.model.enumType.MmochatRoleType;

//杀怪任务
public class MmochatKillMonster implements Serializable {
	private static final long serialVersionUID = 37887691069242315L;
	private MmochatRoleType monsterType = MmochatRoleType.食人草; // 杀怪任务的怪物类型
	private int monsterNum = 0; // 杀怪任务的怪物数量
	private int curKillMonsterNum = 0; // 当前已经杀掉的怪物数量

	public MmochatRoleType getMonsterType() {
		return monsterType;
	}

	public void setMonsterType(MmochatRoleType monsterType) {
		this.monsterType = monsterType;
	}

	public int getMonsterNum() {
		return monsterNum;
	}

	public void setMonsterNum(int monsterNum) {
		this.monsterNum = monsterNum;
	}

	public int getCurKillMonsterNum() {
		return curKillMonsterNum;
	}

	public void setCurKillMonsterNum(int curKillMonsterNum) {
		this.curKillMonsterNum = curKillMonsterNum;
	}

	// 返回是否已经杀够数量
	public boolean addKillMonsterNum(int num) {
		if (num <= 0) {
			return false;
		}
		curKillMonsterNum += num;
		curKillMonsterNum = Math.min(curKillMonsterNum, monsterNum);
		if (curKillMonsterNum == monsterNum) {
			return true;
		}
		return false;
	}

	// 是否已经杀够怪物
	public boolean isKillMonsterFull() {
		return curKillMonsterNum >= monsterNum;
	}
}
